﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using RTGS.Library.DataAccess.UserManagement;
using System.Configuration;
using RTGS.Library.Entities.UserManagement;

namespace RTGS.Web.page.usermanagement
{

    public partial class sys_t_menu_rightslist : BasePage
    {
        private sysTRoleRepo menuDal = new sysTRoleRepo(ConfigurationManager.ConnectionStrings["Rtgs"].ConnectionString);
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                List<sysTRole> roles = menuDal.GetList();
                ddlRole.Items.Clear();
                roles.ForEach(delegate(sysTRole role)
                {
                    ddlRole.Items.Add(new ListItem(role.roleName, role.roleId.ToString()));
                });

                ddlRole.Items.Insert(0, new ListItem("-- select role --", "-1"));
            }

        }
    }

}